<?php
/**
 * 用户基础信息
 */
class UserBase{
  /**
   * @var string Identity
   */
  public $Id;
      
  /**
   * @var string 用户姓名
   */
  public $Name;
      
  /**
   * @var bool 用户性别
   */
  public $UserSex;
      
  /**
   * @var date 用户生日
   */
  public $BirthDay;
      
  /**
   * @var string 用户所属民族
   */
  public $People;
      
  /**
   * @var string 用户邮箱
   */
  public $Email;
      
  /**
   * @var string 用户的手机
   */
  public $Mobile;
      
  /**
   * @var int 状态
   */
  public $Status;
      
  /**
   * @var datetime 建立日期
   */
  public $CreateDate;
      
  /**
   * @var datetime 修改日期
   */
  public $ModifyDate;
      
  public function __construct(){
		$var=get_class_vars(__CLASS__);
    foreach(func_get_args() as $o){
      if(is_array($o)){
        foreach($o as $k => $v){
            if($k=='Id'){
              $this->Id=$v;
              }
            else if($k=='Name'){
                $this->Name=$v;
            }
            else if($k=='UserSex'){
                $this->UserSex=intval($v)>0?true:false;
            }
            else if($k=='BirthDay'){
                $this->BirthDay=intval($v);
            }
            else if($k=='People'){
                $this->People=$v;
            }
            else if($k=='Email'){
                $this->Email=$v;
            }
            else if($k=='Mobile'){
                $this->Mobile=$v;
            }
            else if($k=='Status'){
                $this->Status=intval($v);
            }
            else if($k=='CreateDate'){
                $this->CreateDate=intval($v);
            }
            else if($k=='ModifyDate'){
                $this->ModifyDate=intval($v);
            }
        }
      }else if(is_object($o)){
        foreach($var as $k => $v){
          if(isset($o->Id)){
            $this->Id=$o->Id;
          }
          if(isset($o->Name)){
            $this->Name=$o->Name;
          }
          if(isset($o->UserSex)){
            $this->UserSex=$o->UserSex;
          }
          if(isset($o->BirthDay)){
            $this->BirthDay=$o->BirthDay;
          }
          if(isset($o->People)){
            $this->People=$o->People;
          }
          if(isset($o->Email)){
            $this->Email=$o->Email;
          }
          if(isset($o->Mobile)){
            $this->Mobile=$o->Mobile;
          }
          if(isset($o->Status)){
            $this->Status=$o->Status;
          }
          if(isset($o->CreateDate)){
            $this->CreateDate=$o->CreateDate;
          }
          if(isset($o->ModifyDate)){
            $this->ModifyDate=$o->ModifyDate;
          }
        }
      }
    }
  }

  public function __modetoarray(){
    $var=array();
    foreach(get_class_vars(__CLASS__) as $k => $v){
      $var[$k]=$this->$k;
    }
	return $var;
  }
}
?>